<template>
	<!-- 审核状态 -->
	<view>
		<u-navbar :autoBack="true" :placeholder="true">
			<template #center>
				<view></view>
			</template>
		</u-navbar>
		<view class="minBox">
			<view class="statusBox">
				<image :src="imgUrl" mode=""></image>
			</view>
			<view class="box" v-if="obj.status==1">
				<view class="title">
					平台审核中,请等候
				</view>
			</view>
			<view class="box" v-if="obj.status==2">
				<view class="tips">
					欢迎加入母婴商城 成为商家
				</view>
				<view class="numberBox">
					<text>账号:{{obj.username}}</text>
				</view>
				<view class="numberBox">
					密码:{{obj.password}}
				</view>
				<view class="tipss">
					使用该账号进入商家端小程序
				</view>
			</view>
			<view class="box" v-if="obj.status==3">
				<view class="title">
					申请失败
				</view>
				<view class="err">
					{{obj.rejectmes}}
				</view>
				<view class="btn" @click="againUp">
					重新上传
				</view>
			</view>
		</view>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				obj: {
					status: 1, //1=审核中,2=审核成功,3=审核失败
					password: "",
					username: "",
					rejectmes: ""
				},
				imgUrl: ""
			}
		},
		onLoad(option) {
			this.obj = JSON.parse(option.obj)
			// console.log(this.obj);
			switch (Number(this.obj.status)) {
				case 1:
					this.imgUrl = "http://qiniu.suboshimuying.cn/static/enter/Frame 483590@2x.png"
					break;
				case 2:
					this.imgUrl = "http://qiniu.suboshimuying.cn/static/enter/Frame 483520@2x.png"
					break;
				case 3:
					this.imgUrl = "http://qiniu.suboshimuying.cn/static/enter/Frame 483589@2x.png"
					break;
				default:
					break;
			}
			// console.log(option);
		},
		methods: {
			// 重新申请
			againUp() {
				uni.navigateTo({
					url: `/subPages/enter/enter`
				})
			},
		},
	}
</script>

<style lang="scss">
	page {
		background: #fff;
	}

	.minBox {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		padding: 120rpx 32rpx 0;
		box-sizing: border-box;
		width: 100%;

		.statusBox {

			image {
				width: 340rpx;
				height: 310rpx;
			}
		}

		.box {
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
			width: 100%;

			.tips {
				margin: 36rpx 0 56rpx 0;
				color: rgba(0, 0, 0, 0.8);
				font-size: 32rpx;
				font-weight: 700;
			}

			.numberBox {
				display: flex;
				align-items: center;
				justify-content: space-between;
				width: 420rpx;
				padding: 16rpx 30rpx;
				box-sizing: border-box;
				border-radius: 12rpx;
				color: rgba(0, 0, 0, 0.8);
				font-size: 30rpx;
				background: rgba(248, 249, 254, 1);
				margin-bottom: 20rpx;
			}

			.tipss {
				color: rgba(0, 0, 0, 0.4);
				font-size: 24rpx;
			}

			.fail {
				margin-top: 32rpx;
				color: rgba(0, 0, 0, 0.4);
				font-size: 24rpx;
			}

			.title {
				margin: 36rpx 0;
				color: rgba(0, 0, 0, 0.8);
				font-size: 32rpx;
				font-weight: 700;
			}

			.err {
				margin-bottom: 196rpx;
				color: rgba(252, 67, 56, 1);
				font-size: 32rpx;
			}

			.btn {
				display: flex;
				justify-content: center;
				align-items: center;
				width: 100%;
				height: 88rpx;
				border-radius: 600rpx;
				background: rgba(252, 67, 56, 1);
				color: rgba(255, 255, 255, 1);
				font-size: 32rpx;
				font-weight: 500;
			}
		}
	}
</style>
